﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Gallio.Collections;
using Gallio.Model;
using Gallio.Reflection;
using NFit.Core;

namespace NFit.GallioAdapter
{
    class FixtureTestStep : ITestStep
    {
        private FixtureDefinition _fixture;
        private string _id;

        public FixtureTestStep(ITest test, ITestStep parent, FixtureDefinition fixture)
        {
            Guid g = new System.Guid();
            _id = g.ToString();
            _fixture = fixture;
            this.Parent = parent;
            this.Test = test;
        }

        public string Id
        {
            get { return _fixture.Id; }
        }

        public string Name
        {
            get { return Id; }
        }

        public PropertyBag Metadata
        {
            get { return new PropertyBag(); }
        }

        public ICodeElementInfo CodeElement
        {
            get { return Parent.CodeElement; }
        }

        public string FullName
        {
            get { return Name; }
        }

        public ITestStep Parent { get;private set;}

        public ITest Test { get; private set; }

        public bool IsPrimary
        {
            get { return false; }
        }

        public bool IsDynamic
        {
            get { return true; }
        }

        public bool IsTestCase
        {
            get { return true; }
        }
    }
}
